<div class="row">
<div class="large-12 columns">
	<?=$system_message;?>
	<!--  start here  -->
		
		<br class="clearfix">
		
		<table class="table table-striped table-hover">
			<thead>
				<tr>
					<th>Name of Fee</th>
					<th>Amount</th>
					<th>&nbsp;</th>
				<tr>
			</thead>
			
			<?if($tuit_fees AND $misc_fees AND $cca_fees):?>
			<tbody>
				<!-- tuition fees-->
						<tr>
							<td colspan="3"><span class="label">Tuition Fees:</span></td>
						</tr>
				<?if(!empty($tuit_fees)):?>
					<?foreach($tuit_fees as $key => $value):?>
						<tr>
							<td colspan="2" class="fee_content"><?=$value->sef_fee_name;?></td>
							<td style="text-align:right;"><?=money(round(floatval($value->sef_fee_rate),2));?></td>
						</tr>
					<?endforeach;?>
					<?else:?>
						<tr>
							<td colspan="3"> No Tuition Fee Has Been Set For This Grade Level</td>
						</tr>
				<?endif;?>
				<!--end tuition fees-->
				<!-- Miscellaneous fees-->
					<tr>
						<td colspan="3"><span class="label">Miscellaneous Fees:</span></td>
					</tr>
				<?if(!empty($misc_fees)):?>
					<?foreach($misc_fees as $key => $value):?>
						<tr>
							<td  colspan="2" class="fee_content"><?=$value->sef_fee_name;?></td>
							<td style="text-align:right;"><?=money(round(floatval($value->sef_fee_rate),2));?></td>
						</tr>
					<?endforeach;?>
					<?else:?>
						<tr>
							<td colspan="3"> No Miscellaneous Fee Has Been Set For This Grade Level</td>
						</tr>
				<?endif;?>
				<!-- end registration fees-->
				
				<!-- CCA Fees-->
						<tr>
							<td colspan="3"><span class="label">CCA Fees:</span></td>
						</tr>
				
				<?if(!empty($cca_fees)):?>	
					<?foreach($cca_fees as $key => $value):?>
						<tr>
							<td  colspan="2"  class="fee_content"><?=$value->sef_fee_name;?></td>
							<td style="text-align:right;"><?=money(round(floatval($value->sef_fee_rate),2));?></td>
						</tr>
					<?endforeach;?>
				<?else:?>
					<tr>
						<td colspan="3" style="text-align:center;">
							No Fees.
						</td>	
					</tr>
				<?endif;?>
				<!-- end CCA fees-->
				<?else:?>
					<tr class="info">
						<td colspan="3">
							<strong>Please Contact School Finance/Cashier. Fees were not set automatically</strong>
						</td>
					</tr>
				<?endif;?>

				
				<!-- Student Electives-->
					<tr>
						<td colspan="3"><span class="label">Additional/Optional Fees:</span></td>
					</tr>
				<?if(!empty($elec_fees)):?>
					<?foreach($elec_fees as $key => $value):?>
						<tr>
							<td class="fee_content"><?=$value->sef_fee_name;?></td>
							<td style="text-align:right;"><?=money(round(floatval($value->sef_fee_rate),2));?></td>
						</tr>
					<?endforeach;?>
				<?else:?>
						<tr>
							<td colspan="3" style="text-align:center;">
							No Fees.
						</td>	
						</tr>
				<?endif;?>
				<!-- end Student Electives-->

					<tr>
						<td colspan="3" style="text-align:center;">
							<!-- table Break--><br/>
						</td>	
					</tr>
					<tr class="bordered">
						<td>Total Amount (Tuition Fee + Miscellaneous Fees + Other Fee + Additional Fees</td>
						<td  colspan="2" style="text-align:right;">&#8369; <?php echo money($sum_amount_due);?></td>
					</tr>
					<tr class="bordered">
						<td>Total Amount Paid</td>
						<td   colspan="2"style="text-align:right;">&#8369; <?php echo money(round($sum_paid_fees,2));?></td>
					</tr>
					<tr class="bordered">
						<td>
							<ul>
							<?if(!empty($student_deductions)):?>
								<?
								$count = 1;
								foreach($student_deductions as $sd): ?>
									<li><?=$count.') '.ucwords($sd->sdr_deduction_name);?></li>
								<? 
								$count++;
								endforeach;?>
							<?endif;?>
							</ul>
							Deductions or Scholarships
						</td>
						<td  colspan="2" style="text-align:right;">
						<ul>
							<?if(!empty($student_deductions)):?>
								<? foreach($student_deductions as $sd): ?>
									<li><?=money($sd->sdr_amount);?></li>
								<? endforeach;?>
							<?endif;?>
							</ul>
							&#8369; <?=money($total_stud_deductions);?>
						</td>
					</tr>
					<tr class="total bordered">
						<td>Total Current Charges:</td>
						<td  colspan="2" style="text-align:right;">&#8369; <?php echo money(round($sum_amount_due-$sum_paid_fees,2));?></td>
					</tr>
					<tr class="bordered">
						<td>Total amount Due:</td>
						<td  colspan="2" style="text-align:right;">&#8369; <?php echo money(round($sum_amount_due-$sum_paid_fees,2));?></td>
					</tr>
			</tbody>
		</table>
	<!--  end here  -->
</div>
</div>
